#ifndef BERNSTEINPOLYNOM
#define BERNSTEINPOLYNOM

#include <cmath>

class bernsteinPolynom {

public:

  static float compute(int control_point_ij, float uv) {
    switch (control_point_ij) {
      case 0:
          return pow(1.0f - uv, 3.0f);
        break;
      case 1:
          return 3.0f * uv * pow(1.0f - uv, 2.0f);
        break;
      case 2:
          return 3.0f * uv * uv * (1.0f - uv);
        break;
      case 3:
          return uv * uv * uv;
        break;
      default:
        return 0.0f;
    }
  }
};

#endif